﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace no._3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] num = new int[99];
            for(int i = 0; i <= 98; i++)
            {
                num[i] = i + 2;
            }
            bool[] isnum = new bool[99];
           for(int h = 0; h <= 98; h++)
            {
                isnum[h] = true;
            }
            int k=2, j = 0;
            while (k < 100)
            {
                for (j = 0; j <= 98; j++)
                {
                    if (k != num[j] && num[j] % k == 0)
                    {
                        isnum[j] = false;
                    }
                    
                }
                k = k + 1;
            }
            Console.WriteLine("2-100中素数有：");
            for(int t = 0; t <= 98; t++)
            {
                if (isnum[t])
                {
                    Console.Write(num[t]);
                    Console.Write(" ");
                }
            }
            Console.ReadKey();
        }
    }
}
